def removeElement(nums, val):
    """
    :type nums: List[int]
    :type val: int
    :rtype: int
    """
    i = 0
    for j in range(0, len(nums)):
        if nums[j] != val:
            nums[i] = nums[j]
            i += 1
    return i


nums = [1, 2, 3, 19, 1, 3, 3]
print(removeElement(nums, 3))
